import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";
const routes = [
  {
    path: "/",
    // name: "home", //主页
    component: () => import("../views/home.vue"),
    children: [
      {
        path: "login",
        name: "login",
        component: () => import("../views/login.vue"),
      },
      {
        path: "userInfo",
        name: "userInfo",
        component: () => import("../views/userInfo.vue"),
      },
      {
        path: "",
        // name: "menu",
        component: () => import("../views/menu.vue"),
        meta: { home: true },
        children: [
          {
            path: "",
            name: "work",
            component: () => import("../views/management/work.vue"),
            meta: { title: "工作管理", jurisdiction: 1 },
          },
          {
            path: "vehicle",
            name: "vehicle",
            component: () => import("../views/management/vehicle.vue"),
            meta: { title: "车辆信息", jurisdiction: 2 },
          },
          {
            path: "camera",
            name: "camera",
            component: () => import("../views/management/camera.vue"),
            meta: { title: "地铁站摄像头", jurisdiction: 3 },
          },
          {
            path: "cameralist",
            name: "cameralist",
            component: () => import("../views/management/cameralist.vue"),
            meta: { title: "地铁站摄像头详情", jurisdiction: 4 },
          },
          {
            path: "user",
            name: "user",
            component: () => import("../views/management/user.vue"),
            meta: { title: "用户管理", jurisdiction: 5 },
          },
          {
            path: "depat",
            name: "depat",
            component: () => import("../views/management/depart.vue"),
            meta: { title: "部门管理", jurisdiction: 5 },
          },
        ],
      },
    ],
  },
  // {
  //   path: "/login",
  //   name: "login", //登录
  //   component: () => import("../views/login.vue"),
  // },
];
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes,
});

export default router;
